TryPeek Method

Task Parallel System.Threading

Attempts to return an object from the top of the ConcurrentStack<(Of <(T>)>) without removing it.

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Function TryPeek ( _
	<OutAttribute> ByRef result As T _
) As Boolean
C#
public bool TryPeek(
	out T result
)

Parameters

result
Type: T %
When this method returns, result contains an object from the top of the ConccurrentStack<(Of <(T>)>) or an unspecified value if the operation failed.

Return Value

true if and object was returned successfully; otherwise, false.

See Also